package com.huawei.weather.controller;

import com.huawei.weather.domain.WeatherResponse;
import com.huawei.weather.service.WeatherService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.thymeleaf.ThymeleafProperties;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController   //接口方法返回json格式数据
public class WeatherController {

    ThymeleafProperties thymeleafProperties;

    @Autowired
    WeatherService weatherService;

    @RequestMapping("/find")
    public WeatherResponse find(String cityId){

        return weatherService.findWeatherByCityId(cityId);

    }

}
